<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<h2>Hello Swoole Http Server</h2>

<script>
    let ws = new WebSocket( 'ws://192.168.101.140:9501' );
    ws.onopen = function () {
        console.log( '打开连接' );
    };
    ws.onmessage = function ( event ) {
        console.log( event.data );
    };
    ws.onclose = function () {
        console.log( '服务器断开连接' );
    };
    ws.onerror = function () {
        console.log( '发生错误了' );
    };
</script>
</body>
</html>
